{
 "cells": [
  {
   "cell_type": "code",
   "id": "initial_id",
   "metadata": {
    "collapsed": true,
    "ExecuteTime": {
     "end_time": "2025-09-16T15:33:25.659718Z",
     "start_time": "2025-09-16T15:33:24.027591Z"
    }
   },
   "source": [
    "# 直方图\n",
    "# 直方图均衡化\n",
    "\n",
    "\n",
    "import cv2\n",
    "import numpy as np\n",
    "import matplotlib.pyplot as plt\n",
    "\n",
    "# 设置中文字体\n",
    "plt.rcParams['font.sans-serif'] = ['SimHei']\n",
    "plt.rcParams['axes.unicode_minus'] = False\n",
    "\n",
    "# 输入数据\n",
    "data = np.array([\n",
    "    [255, 128, 200, 50],\n",
    "    [50,  200, 255, 50],\n",
    "    [255, 200, 128, 128],\n",
    "    [200, 200, 255, 50]\n",
    "], dtype=np.uint8)\n",
    "\n",
    "# 使用OpenCV的equalizeHist函数（需要先将数据视为图像）\n",
    "# 注意：equalizeHist需要单通道图像\n",
    "equalized = cv2.equalizeHist(data)\n",
    "\n",
    "print(\"原始数据:\")\n",
    "print(data)\n",
    "print(\"\\nOpenCV均衡化结果:\")\n",
    "print(equalized)\n",
    "\n",
    "# 显示结果\n",
    "plt.figure(figsize=(10, 4))\n",
    "plt.subplot(1, 2, 1)\n",
    "plt.imshow(data, cmap='gray')\n",
    "plt.title('原始图像')\n",
    "plt.axis('off')\n",
    "\n",
    "plt.subplot(1, 2, 2)\n",
    "plt.imshow(equalized, cmap='gray')\n",
    "plt.title('OpenCV均衡化')\n",
    "plt.axis('off')\n",
    "\n",
    "plt.tight_layout()\n",
    "plt.show()"
   ],
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "原始数据:\n",
      "[[255 128 200  50]\n",
      " [ 50 200 255  50]\n",
      " [255 200 128 128]\n",
      " [200 200 255  50]]\n",
      "\n",
      "OpenCV均衡化结果:\n",
      "[[255  64 170   0]\n",
      " [  0 170 255   0]\n",
      " [255 170  64  64]\n",
      " [170 170 255   0]]\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "<Figure size 1000x400 with 2 Axes>"
      ],
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAA0YAAAGGCAYAAABfU5GFAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAAAfdElEQVR4nO3deZBV5Z3w8V8vNMgio7IFJ2ApDrIYEXEDFAhLqRGIlgZDXCKOQQmi4wA6JUZrQgSDGRRLQkajGaOD4zYBBUlAETcSZXMjiBSgaYUAQWVvaPp5/+DlvjaNSt4RmfB8PlWninv63HOfe4rq0997zj2nKKWUAgAAIGPFB3oAAAAAB5owAgAAsieMAACA7AkjAAAge8IIAADInjACAACyJ4wAAIDsCSMAACB7wggAAMieMOJ/lZRSVFRUREqpMO/Pf/5zrFixYq/Lr1u37qsaWvzmN7+JhQsXFh5/9NFHMWLEiFi6dOlXNgYA+N9s586dUV5evs/Lf/jhh4V/P/744/HII4/81a+5efPm2Lp1a+FxSilWr14d27Zt+6vXRd6EEfvdvffeG0VFRfs0FRcXR506deKDDz4oPH/27NnRvn372LhxY411/+M//mN06dIlqqqq9vra77///j6/9qenp59+usa6/uVf/iWuuOKK2LlzZ0RE/PjHP4577703tm/f/iVtKQD429GoUaO47bbbqs2bN29efP3rX485c+Z84fPfe++9aNu2bTz66KOxevXquOqqq2LZsmV/9Th+9atfRYsWLWLlypUREbFp06b42te+FjNnzvyr10XehBH7Xe3ataNhw4axcePGatPEiRNj5MiR1eZt2LAh1q1bF1/72tcKzy8vL49TTz01GjRoUG29q1atiunTp8cll1wSxcV7/69cWloaERHz58+PrVu3xtatW2PTpk1x8803x8qVKwvzPj2VlJRE7dq1q63nnXfeiSVLlsRNN90UJSUl8dRTT8Wdd94ZW7duje7du0ejRo2iUaNGMWrUqC956wFwMNmxY0eMGDEimjZtGvXq1Yt+/fr9VUdYvgyvvvpqnHbaaXHIIYdE27Zt45lnnomIiBdeeCGKiopiypQp1ZZ//vnn9/qh4SGHHBJ169atNu+5556Ldu3aRbdu3T53DJs3b47zzz8/OnToEN27d49+/frFX/7ylxg/fnw0atQoevXqVVjfYYcdFo0aNYqGDRvGe++9V209KaWYOHFi9O7dO4466qjCuCIiatWqVW3ZTx9Vgr0pPdAD4OC3O1rq169fbf5TTz0VRx99dI35e1q+fHm0adOmxvwxY8bESSedFIMHD46UUkyYMCG+//3vR8OGDQvL7A6jsrKyqFOnTkRE3HfffTF69Og45ZRTomnTpoVly8rKCmMtKSmp9loTJ06Mxo0bR//+/WP27NkxYMCAuPHGGwuflL3xxhtx8sknx+DBg/dpmwCQp3/+53+OiRMnxtixY+OYY46JH/7wh3HOOefEwoULa+x79od33303evXqFd27d4/p06fHtGnTon///vH222/H6aefHg0aNIjnn38++vfvX3jOnDlzolatWtG9e/dq6yopKSnsZ3d7/PHH44gjjoixY8fWeO1LLrkkjjzyyNiwYUN8+9vfju3bt8dvfvObGDZsWBQVFcXmzZujpKQkWrZsGddff31ERHTu3DmWLl0atWrVioqKijjiiCOqrXPq1KmxePHiePTRRz/3fc+ePTt+8IMfxNSpU/f6NwVERESC/ezXv/51atiwYUoppVGjRqWSkpJUUlKSIiIVFxcXHu+e/vjHP6aUUho3blw69thjU4MGDVKTJk1Su3btUrt27dLChQvT0qVL06GHHprefvvtlFJK69evT8cdd1w699xzU1VVVeG1169fnyIivfnmmymllD788MPUqFGjFBHVpsaNG6dPPvkkpZRSSUlJmj17dmEdf/7zn1ODBg1St27d0ty5c1Pt2rVTcXFxOuKIIwpTvXr1UklJSeHxgAEDvoItC8DfkvXr16fS0tJ07bXXFuZNmTIlRUSaOnXqVzKGiy++ODVt2jRt2bKlMK9t27bpBz/4QUoppb59+6YOHTpUe0737t3TGWeckVJKafv27WnevHlp8eLFqXnz5mnUqFHp9ddfT6tWrUqLFy9OEZEuuuii9L3vfa8w9evXL0VEmjdvXkoppfvvvz8de+yxqby8PK1atSqtXLkyDRgwIA0ePDide+65qU6dOmnw4MHpqquuSjt37vzM97Jt27b0D//wD6lFixbV5u/YsSNFRHrmmWdSSimVl5en5s2bp9NPPz1t2rTpf74ROWg5lY6vVFlZWXTt2jUqKysjpRQ7d+6MysrKqKysjEWLFsXOnTsLp7F17949Ro0aFTt27Ihhw4bF8OHD4+23345atWrFwIED44Ybboi2bdtGxK7D5ZMmTYqZM2fGLbfcUni9oqKiwr+3bt0aAwYMiHXr1sW9994bKaV477334rDDDotJkybFoYceutcxjxw5MrZs2RIREaeddlq88sorccQRR8QjjzwS69ati0GDBsX5558flZWVsW7duhg6dKjvHQFQw8svvxyVlZXRu3fvwryePXtGROzTd3L+p6qqqmLq1KnxrW99q3C6WUREp06d4q233oqIiN69e8cbb7wRH330UUREbN++PX7/+99Hnz59IiLiL3/5S3Tq1Cnatm0bH374YYwePTpOOOGEeOihh+Lf/u3fomfPnjF58uR46KGHCtPuo0e7z9y4/PLLY968efHBBx/EMcccE6+99lr813/9V3Ts2DHWr18f559/frRs2TIeeOCBWLt2bbz//vtRXl4e7733XqxZs6Yw7n/913+NpUuXVtvX76m8vDx69eoVzZo1i2eeeSbq1av35W5UDirCiK/U5/3y2nOZTp06Rbdu3aKysjL+6Z/+KTp37hy1a9eOF198MebNmxdjx46N+vXrR61ataJFixZx+eWXx3HHHRc/+clP9nrxhPHjx8fq1atj2rRpMXz48LjtttvirLPOimuvvTbOP//8vY5l8uTJ8fDDD8ewYcMK8zp27Bjbt2+P73znO9GsWbO48847Y8qUKdGsWbNo1qxZ3HHHHa6EA0ANy5cvj4iIFi1aFObVq1cvDjvssFixYkUcddRRce2118aZZ54ZdevWjZNPPjleeeWVautYtGhRfPOb34xDDjkkjj766LjzzjsLP9v9XaDVq1dH3759o169etGqVauYMWNGROy6INGGDRuidevW1dZ54403FuKlT58+UVVVFS+++GJERPzhD3+Ibdu2FWKuadOmsWXLlqiqqoqWLVvG3XffHdu2bYuzzz47HnzwwRg2bFhceuml8cc//rGw/t0fFu4Oo4hdgfXtb387+vTpE2eeeeZet1dpaWn8+Mc/jpYtW8bXv/71OOqoo2LChAkREfGf//mfMWbMmM/cf0dELFu2LLp27Rp169aNmTNnVjvVHvZGGPGV+PTFEebMmROlpaU1pg4dOtR43osvvhgdOnSIunXrxoIFC6Jdu3Zx8cUXx1133RVPP/10LFmyJLZu3Rrr16+P5cuXx6JFi+Kxxx6rcR50xK5f/C+99FKcccYZcfbZZ8dNN90UmzdvrnYe9Z7OOeecuP/++6Njx47V5n/88ccxYcKEKCoqii5dusTHH38cq1evjgULFsQjjzwS06dP///eVgAcnHZfXXXPoxb16tUr/Ozuu++Ozp07x9SpU6N58+bRp0+fWLVqVUTsiomePXvG4YcfHjNmzIjrr78+hg8fHr/85S+rre/ss8+O1q1bx9SpU6Nly5Zx6aWXRlVVVeFoy+GHH15t+TZt2sQZZ5wRERGtW7eOFi1axPPPPx8Ru2Lr7/7u76JTp04RsevDy0MOOaTaB521a9eOefPmxZlnnhl9+/aNioqK6Nu3b2zYsCEiaobRW2+9Fd26dYtVq1bFmDFjCrfoqF+/fpSWlkbt2rWjbt26sXPnzrjzzjtj586dceSRR8Yrr7wSt956a2zfvj1+9KMfxXXXXRfnnXfeZ27v6667Llq3bh2zZ8+u8Z5hb4QR+93mzZsLF1hIKRWOAu05LVq0KCKicDnsiIhnn302unbtGhG7rpZz6qmnRv369eOCCy6IJk2axKZNm2LZsmWxZMmSwtS1a9caF3SoqqqKxx57LG6++eZo2bJlrFmzJubMmRPnnXdenHrqqdGxY8e49tprC5/m7dawYcO45JJLqr2XMWPGROvWreO2226LH/3oR/HCCy/EfffdF0888UR06tQpbr/99r1eWhwAIqLavfp2P94dGj169IixY8dGr1694qGHHoqIiPvvvz8idkVTSUlJTJ48Obp16xZDhw6N/v37x4MPPlhtfWeccUbccccd0bNnzxg7dmysXbs2Vq1aFRUVFRERn3kl19169+5dCKM5c+ZEz549v/DCEJdddlnMnDkzioqK4oEHHog6derEggULIqUUO3bsiIj/d7W47373u9G9e/eoV69el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z44033ohrrrkmzj333Fi0aFHcfvvtcfXVV8fbb7+9z+sEIA9dunSJsrKymDlzZmHes88+GxG7TqGLiMJFDyIiNmzYEO+8804ce+yxEbErKN5///1o06ZNdOjQITp06BDvvPNOTJo0qdrrfNZ+sEGDBnH66afH9OnTo7KyMiJ2Rc3cuXPjpJNOKix3+OGHR8eOHeOuu+6KY445phBtn1ZRURGVlZUxefLkaNGiRTz00EORUor7778/2rRpE9u3b4833ngjzjnnnNixY0e1ewXu6aKLLorjjz8+2rZtGytWrIgxY8ZE+/bt44QTTohf/OIXX7hdIyL69+8fzz77bEyfPj2aNWu212Xc4JUvIozYrxYvXhzLli0r3AH7pz/9aTzxxBM1bghXVFQUW7Zsia5du8bChQur/WzGjBlRq1atGDFiRJx11lnx4IMP7tPV7SKqf19pt5tvvjkGDhwYjz/+eLRt2zZGjBhRY5mqqqq9Pm7QoEHMnz8/rrrqqrjgggviD3/4Q7z22mtxyimnRHFxcXzrW9+KSy+9NDp37hyvvfbaPo0RgDwceuihMXTo0Jg4cWLccccd8d///d8xZMiQOPHEEwunir/88ssxcuTImDVrVlx88cVRXFwcgwYNioiIa665JioqKuKiiy6KZ599NiZPnhxDhgz5wu8Mfdptt90Wy5cvjwEDBsTMmTPj8ssvj/Ly8rj66qurLdenT5+oqKiocbTopZdeKlwAYt26ddG4ceP46U9/GpdddlmMGzcurrzyyrjuuutixowZhUDZvn17tSvS7en3v/99bNy4MW699dY4+uij47LLLovXX389tm7dWu0WHHuz+4yRiIhvfvObn7vsXXfdFd27d69xKiEUfNU3TiIvgwcPTk2aNEkVFRVp9OjRqXbt2mnatGmFn59wwgnppptuSimlVFlZmS655JJ02GGHpSVLlqSUUnrzzTdTgwYN0n333ZdSSunhhx9Oy5YtS4MGDapxk9bd0y233FJY/+rVq1NEpFmzZqU//elPNaapU6emp59+utq8kpKS9Nvf/rba+7j33ntT165dU0opDRgwIDVs2DCNHz8+VVZWpk2bNqWuXbumkSNHFpafNWvWftmeAPxt27FjR7rh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INHDjwQA/hoLXn3dD58rgmDvzP9OjR40AP4aA1ZMiQAz2Eg9Z3vvOdAz2Eg9a+7lcdMQIAALInjAAAgOwJIwAAIHvCCAAAyJ4wAgAAsieMAACA7AkjAAAge8IIAADInjACAACyJ4wAAIDsCSMAACB7wggAAMieMAIAALInjAAAgOwJIwAAIHvCCAAAyJ4wAgAAsieMAACA7AkjAAAge8IIAADInjACAACyJ4wAAIDsCSMAACB7wggAAMieMAIAALInjAAAgOwJIwAAIHvCCAAAyJ4wAgAAsieMAACA7AkjAAAge8IIAADInjACAACyJ4wAAIDsCSMAACB7wggAAMieMAIAALInjAAAgOwJIwAAIHvCCAAAyJ4wAgAAsieMAACA7AkjAAAge8IIAADInjACAACyJ4wAAIDsCSMAACB7wggAAMieMAIAALInjAAAgOwJIwAAIHvCCAAAyJ4wAgAAsieMAACA7AkjAAAge8IIAADInjACAACyJ4wAAIDsCSMAACB7wggAAMieMAIAALInjAAAgOwJIwAAIHvCCAAAyJ4wAgAAsieMAACA7AkjAAAge8IIAADInjACAACyJ4wAAIDsCSMAACB7wggAAMieMAIAALInjAAAgOwJIwAAIHvCCAAAyJ4wAgAAsieMAACA7AkjAAAge8IIAADInjACAACyJ4wAAIDsCSMAACB7wggAAMieMAIAALInjAAAgOyV7uuCRUVF+3McWZs5c+aBHsJBq1evXgd6CAB7Zb+6/zz66KMHeggHrQsvvPBADwH2G0eMAACA7AkjAAAge8IIAADInjACAACyJ4wAAIDsCSMAACB7wggAAMieMAIAALInjAAAgOwJIwAAIHvCCAAAyJ4wAgAAsieMAACA7AkjAAAge8IIAADInjACAACyJ4wAAIDsCSMAACB7wggAAMieMAIAALInjAAAgOwJIwAAIHvCCAAAyJ4wAgAAsieMAACA7AkjAAAge8IIAADInjACAACyJ4wAAIDsCSMAACB7wggAAMieMAIAALInjAAAgOwJIwAAIHvCCAAAyJ4wAgAAsieMAACA7AkjAAAge8IIAADInjACAACyJ4wAAIDsCSMAACB7wggAAMieMAIAALInjAAAgOwJI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hjjx3oIcBf7cILLzzQQzho2a/uP/u6X3XECAAAyJ4wAgAAsieMAACA7AkjAAAge8IIAADInjACAACyJ4wAAIDsCSMAACB7wggAAMieMAIAALInjAAAgOwJIwAAIHvCCAAAyJ4wAgAAsieMAACA7AkjAAAge8IIAADInjACAACyJ4wAAIDsCSMAACB7wggAAMieMAIAALInjAAAgOwJIwAAIHvCCAAAyJ4wAgAAsieMAACA7AkjAAAge8IIAADInjACAACyJ4wAAIDsCSMAACB7wggAAMieMAIAALInjAAAgOwJIwAAIHvCCAAAyJ4wAgAAsieMAACA7AkjAAAge8IIAADInjACAACyJ4wAAIDsCSMAACB7wggAAMieMAIAALInjAAAgOwJIwAAIHvCCAAAyJ4wAgAAsieMAACA7AkjAAAge8IIAADInjACAACyJ4wAAIDsCSMAACB7wggAAMieMAIAALInjAAAgOwJIwAAIHvCCAAAyJ4wAgAAsieMAACA7AkjAAAge8IIAADInjACAACyJ4wAAIDsCSMAACB7wggAAMieMAIAALInjAAAgOwJIwAAIHvCCAAAyJ4wAgAAsieMAACA7AkjAAAge8IIAADInjACAACyJ4wAAIDsCSMAACB7wggAAMieMAIAALInjAAAgOwJIwAAIHvCCAAAyJ4wAgAAsleUUkoHehAAAAAHkiNGAABA9oQRAACQPWEEAABkTxgBAADZE0YAAED2hBEAAJA9YQQAAGRPGAEAANkTRgAAQPb+D/XM0SEdpwWmAAAAAElFTkSuQmCC"
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "execution_count": 1
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-09-16T15:39:27.167633Z",
     "start_time": "2025-09-16T15:39:24.558772Z"
    }
   },
   "cell_type": "code",
   "source": [
    "import cv2\n",
    "import matplotlib.pyplot as plt\n",
    "img = cv2.imread(r'data/cat.png', 0)\n",
    "plt.hist(img.ravel(), 256)\n",
    "plt.show()"
   ],
   "id": "30c5bfbacc60c215",
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<Figure size 640x480 with 1 Axes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3fTee+8pPj5ed911l2bOnKm6ujr7Mea9+zwejyQpLi5OEtt7X2k979f1xfZO0Omkf/3rX7p69WqbHxRNSEho88Oj6Lq0tDS9/vrreuedd7R582a53W5lZGToyy+/tOeZz6B3dWae3W63IiIiNHDgwBvWwHdTpkzRrl279O677+qVV15RZWWlHn30UTU3N0ti3rvLsiwtWrRIDz/8sFJSUiSxvfeF9uZd6rvtPaB/AiIQhYSEeN23LKvNMnTdlClT7P8eNWqU0tPT9c1vflPbt2+3D1LjM+gbXZlnPovumT59uv3fKSkpGj16tIYNG6a9e/dq6tSpN3we89458+fP1wcffKDy8vI2j7G9954bzXtfbe90dDpp8ODBCg0NbZMi6+rq2vxLAD0nOjpao0aN0scff2yffcVn0Ls6M89Op1MtLS2qr6+/YQ26b8iQIRo2bJg+/vhjScx7dyxYsEBvvfWWDhw4oKFDh9rL2d57143mvT29tb0TdDopIiJCqampKi0t9VpeWlqqjIwMP43KfM3NzTp58qSGDBmipKQkOZ1Or8+gpaVFZWVlfAY9qDPznJqaqvDwcK+a2tpaHT9+nM+iB3355ZeqqanRkCFDJDHvXWFZlubPn68333xT7777rpKSkrweZ3vvHTeb9/b02vbe6cOWYRUXF1vh4eHWli1brA8//NDKy8uzoqOjrU8//dTfQzPG4sWLrffee8/65JNPrEOHDllZWVlWTEyMPcerV6+2HA6H9eabb1rHjh2znnrqKWvIkCFWQ0ODn0ceXBobG62jR49aR48etSRZhYWF1tGjR63PPvvMsqzOzfOcOXOsoUOHWvv377fef/9969FHH7Xuu+8+68qVK/5arYDX0bw3NjZaixcvtioqKqzTp09bBw4csNLT061vfOMbzHs3/PSnP7UcDof13nvvWbW1tfbt0qVLdg3be8+72bz35fZO0PHR7373O2vYsGFWRESE9cADD3idKofumz59ujVkyBArPDzccrlc1tSpU60TJ07Yj1+7ds1auXKl5XQ6rcjISOu73/2udezYMT+OODgdOHDAktTm9swzz1iW1bl5bmpqsubPn2/FxcVZUVFRVlZWlnXmzBk/rE3w6GjeL126ZGVmZlq33367FR4ebt1xxx3WM88802ZOmXfftDffkqytW7faNWzvPe9m896X23vI/wYEAABgHI7RAQAAxiLoAAAAYxF0AACAsQg6AADAWAQdAABgLIIOAAAwFkEHAAAYi6ADAACMRdABAADGIugAAABjEXQAAICxCDoAAMBY/x/FnzhVL6vcwAAAAABJRU5ErkJggg=="
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "execution_count": 5
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-09-16T15:39:28.403946Z",
     "start_time": "2025-09-16T15:39:27.886890Z"
    }
   },
   "cell_type": "code",
   "source": [
    "equ = cv2.equalizeHist(img)\n",
    "plt.hist(equ.ravel(), 256)\n",
    "plt.show()"
   ],
   "id": "1419a59432676d9c",
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ],
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAjEAAAGdCAYAAADjWSL8AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAAAi9klEQVR4nO3de1BU5/3H8c+Gm8jARrSwUomSDjE22DTBFCEXnahEG0IyztQkpEwytV7qrUSt1bFtaGYCiW2QKTRGraMmaMg/sc3UlIiN0lhvlEijxjGZiY2YsGJTXDBS8HJ+f3Q8vywIstx2n+X9mjkz7jnf3X3O44H98Jzn7HFYlmUJAADAMDf5uwEAAAA9QYgBAABGIsQAAAAjEWIAAICRCDEAAMBIhBgAAGAkQgwAADASIQYAABgp1N8N6C9Xr17VF198oejoaDkcDn83BwAAdINlWWpublZCQoJuuqnrsZagDTFffPGFEhMT/d0MAADQA3V1dRo1alSXNUEbYqKjoyX9rxNiYmL83BoAANAdTU1NSkxMtD/HuxK0IebaKaSYmBhCDAAAhunOVBAm9gIAACMRYgAAgJEIMQAAwEiEGAAAYCRCDAAAMBIhBgA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YHH3xgPfjgg9add95pXb582V+7FTC66t/m5mZr2bJl1v79+61Tp05Ze/bssdLT061vfvOb9G83/eQnP7GcTqe1d+9eq76+3l4uXrxo13AM986N+tjE45gQ46Pf//731ujRo63w8HDr7rvv9ro0Dd33+OOPWyNHjrTCwsKshIQEa+bMmdbx48ft7VevXrWee+45y+VyWREREdYDDzxgHT161I8tDnx79uyxJHVYnn76acuyutenLS0t1qJFi6zY2FgrMjLSysrKsk6fPu2HvQk8XfXvxYsXrczMTOsb3/iGFRYWZt1yyy3W008/3aHv6N/OXa9vJVmbN2+2aziGe+dGfWziceywLMsauHEfAACAvsGcGAAAYCRCDAAAMBIhBgAAGIkQAwAAjESIAQAARiLEAAAAIxFiAACAkQgxAADASIQYAABgJEIMAAAwEiEGAAAYiRADAACM9H8JKShiK4yI/QAAAABJRU5ErkJggg=="
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "execution_count": 6
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-09-16T15:44:15.531646Z",
     "start_time": "2025-09-16T15:44:03.348022Z"
    }
   },
   "cell_type": "code",
   "source": [
    "import numpy as np\n",
    "res = np.hstack((img, equ))\n",
    "cv2.namedWindow('img', cv2.WINDOW_NORMAL)\n",
    "cv2.imshow('img', res)\n",
    "cv2.waitKey(0)\n",
    "cv2.destroyAllWindows()"
   ],
   "id": "2c5ad2d47d50cf61",
   "outputs": [],
   "execution_count": 8
  },
  {
   "metadata": {},
   "cell_type": "code",
   "outputs": [],
   "execution_count": null,
   "source": "",
   "id": "2b29918d624dccce"
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
